<template>
  <div class="overview">
    <AllView :can-show="canShow" />
    <Norm :can-show="canShow" />
    <Node :can-show="canShow" />
    <Block :can-show="canShow" />
    <Trade :can-show="canShow" />
  </div>
</template>

<script>
import { checkCanShowOverview } from '@/api/overview'
import AllView from './allView.vue'
import Norm from './norm.vue'
import Node from './node.vue'
import Block from './block.vue'
import Trade from './trade.vue'
export default {
  name: 'Overview',
  components: { AllView, Norm, Node, Block, Trade },
  data() {
    return {
      canShow: false
    }
  },
  mounted() {
    this.checkPurview()
  },
  methods: {
    async checkPurview() {
      try {
        const { code } = await checkCanShowOverview()
        if (!code) {
          this.canShow = true
        }
      } catch (error) {
        console.error(error)
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.overview {
	width: 1350px;
	margin: 0 auto;
	padding-top: 15px;
}
</style>
